Optimal. Leaf size=85 \[ -\frac{(A c+2 A d+2 B c-5 B d) \cos (e+f x)}{3 a^2 f (\sin (e+f x)+1)}+\frac{B d x}{a^2}-\frac{(A-B) (c-d) \cos (e+f x)}{3 f (a \sin (e+f x)+a)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.210815, antiderivative size = 85, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.121, Rules used = {2968, 3019, 2735, 2648} \[ -\frac{(A c+2 A d+2 B c-5 B d) \cos (e+f x)}{3 a^2 f (\sin (e+f x)+1)}+\frac{B d x}{a^2}-\frac{(A-B) (c-d) \cos (e+f x)}{3 f (a \sin (e+f x)+a)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2968
Rule 3019
Rule 2735
Rule 2648
Rubi steps
\begin{align*} \int \frac{(A+B \sin (e+f x)) (c+d \sin (e+f x))}{(a+a \sin (e+f x))^2} \, dx &=\int \frac{A c+(B c+A d) \sin (e+f x)+B d \sin ^2(e+f x)}{(a+a \sin (e+f x))^2} \, dx\\ &=-\frac{(A-B) (c-d) \cos (e+f x)}{3 f (a+a \sin (e+f x))^2}-\frac{\int \frac{-a (2 B (c-d)+A (c+2 d))-3 a B d \sin (e+f x)}{a+a \sin (e+f x)} \, dx}{3 a^2}\\ &=\frac{B d x}{a^2}-\frac{(A-B) (c-d) \cos (e+f x)}{3 f (a+a \sin (e+f x))^2}+\frac{(A c+2 B c+2 A d-5 B d) \int \frac{1}{a+a \sin (e+f x)} \, dx}{3 a}\\ &=\frac{B d x}{a^2}-\frac{(A-B) (c-d) \cos (e+f x)}{3 f (a+a \sin (e+f x))^2}-\frac{(A c+2 B c+2 A d-5 B d) \cos (e+f x)}{3 f \left (a^2+a^2 \sin (e+f x)\right )}\\ \end{align*}
Mathematica [B] time = 0.341272, size = 180, normalized size = 2.12 \[ \frac{\left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right ) \left (2 (A-B) (c-d) \sin \left (\frac{1}{2} (e+f x)\right )+2 (A c+2 A d+2 B c-5 B d) \sin \left (\frac{1}{2} (e+f x)\right ) \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )^2-(A-B) (c-d) \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )+3 B d (e+f x) \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )^3\right )}{3 a^2 f (\sin (e+f x)+1)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.077, size = 252, normalized size = 3. \begin{align*} 2\,{\frac{Bd\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) }{{a}^{2}f}}-2\,{\frac{Ac}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}+2\,{\frac{Bd}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}+2\,{\frac{Ac}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}-2\,{\frac{Ad}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}-2\,{\frac{Bc}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}+2\,{\frac{Bd}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}-{\frac{4\,Ac}{3\,{a}^{2}f} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-3}}+{\frac{4\,Ad}{3\,{a}^{2}f} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-3}}+{\frac{4\,Bc}{3\,{a}^{2}f} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-3}}-{\frac{4\,Bd}{3\,{a}^{2}f} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.46278, size = 613, normalized size = 7.21 \begin{align*} \frac{2 \,{\left (B d{\left (\frac{\frac{9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac{3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 4}{a^{2} + \frac{3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac{3 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac{3 \, \arctan \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}}\right )} - \frac{A c{\left (\frac{3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac{3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 2\right )}}{a^{2} + \frac{3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac{3 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} - \frac{B c{\left (\frac{3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}}{a^{2} + \frac{3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac{3 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} - \frac{A d{\left (\frac{3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}}{a^{2} + \frac{3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac{3 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}\right )}}{3 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.88666, size = 491, normalized size = 5.78 \begin{align*} -\frac{6 \, B d f x -{\left (3 \, B d f x +{\left (A + 2 \, B\right )} c +{\left (2 \, A - 5 \, B\right )} d\right )} \cos \left (f x + e\right )^{2} -{\left (A - B\right )} c +{\left (A - B\right )} d +{\left (3 \, B d f x -{\left (2 \, A + B\right )} c -{\left (A - 4 \, B\right )} d\right )} \cos \left (f x + e\right ) +{\left (6 \, B d f x +{\left (A - B\right )} c -{\left (A - B\right )} d +{\left (3 \, B d f x -{\left (A + 2 \, B\right )} c -{\left (2 \, A - 5 \, B\right )} d\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{3 \,{\left (a^{2} f \cos \left (f x + e\right )^{2} - a^{2} f \cos \left (f x + e\right ) - 2 \, a^{2} f -{\left (a^{2} f \cos \left (f x + e\right ) + 2 \, a^{2} f\right )} \sin \left (f x + e\right )\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 10.6344, size = 986, normalized size = 11.6 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.27019, size = 190, normalized size = 2.24 \begin{align*} \frac{\frac{3 \,{\left (f x + e\right )} B d}{a^{2}} - \frac{2 \,{\left (3 \, A c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 3 \, B d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 3 \, A c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 3 \, B c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 3 \, A d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 9 \, B d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 2 \, A c + B c + A d - 4 \, B d\right )}}{a^{2}{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1\right )}^{3}}}{3 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]